/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alvaro
 */
@Entity
@Table(name = "company_configuration")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CompanyConfiguration.findAll", query = "SELECT c FROM CompanyConfiguration c"),
    @NamedQuery(name = "CompanyConfiguration.findByIdCompanyConfiguration", query = "SELECT c FROM CompanyConfiguration c WHERE c.idCompanyConfiguration = :idCompanyConfiguration"),
    @NamedQuery(name = "CompanyConfiguration.findByFacesPerRow", query = "SELECT c FROM CompanyConfiguration c WHERE c.facesPerRow = :facesPerRow"),
    @NamedQuery(name = "CompanyConfiguration.findByShowAdquiredProfiles", query = "SELECT c FROM CompanyConfiguration c WHERE c.showAdquiredProfiles = :showAdquiredProfiles")})
public class CompanyConfiguration implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "SHOW_NAME")
    private boolean showName;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_COMPANY_CONFIGURATION")
    private Integer idCompanyConfiguration;
    @Basic(optional = false)
    @NotNull
    @Column(name = "FACES_PER_ROW")
    private int facesPerRow;
    @Basic(optional = false)
    @NotNull
    @Column(name = "SHOW_ADQUIRED_PROFILES")
    private boolean showAdquiredProfiles;
    @JoinColumn(name = "COMPANY", referencedColumnName = "ID_COMPANY")
    @ManyToOne(optional = false)
    private Company company;

    public CompanyConfiguration() {
    }

    public CompanyConfiguration(Integer idCompanyConfiguration) {
        this.idCompanyConfiguration = idCompanyConfiguration;
    }

    public CompanyConfiguration(Integer idCompanyConfiguration, int facesPerRow, boolean showAdquiredProfiles) {
        this.idCompanyConfiguration = idCompanyConfiguration;
        this.facesPerRow = facesPerRow;
        this.showAdquiredProfiles = showAdquiredProfiles;
    }

    public Integer getIdCompanyConfiguration() {
        return idCompanyConfiguration;
    }

    public void setIdCompanyConfiguration(Integer idCompanyConfiguration) {
        this.idCompanyConfiguration = idCompanyConfiguration;
    }

    public int getFacesPerRow() {
        return facesPerRow;
    }

    public void setFacesPerRow(int facesPerRow) {
        this.facesPerRow = facesPerRow;
    }

    public boolean getShowAdquiredProfiles() {
        return showAdquiredProfiles;
    }

    public void setShowAdquiredProfiles(boolean showAdquiredProfiles) {
        this.showAdquiredProfiles = showAdquiredProfiles;
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCompanyConfiguration != null ? idCompanyConfiguration.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CompanyConfiguration)) {
            return false;
        }
        CompanyConfiguration other = (CompanyConfiguration) object;
        if ((this.idCompanyConfiguration == null && other.idCompanyConfiguration != null) || (this.idCompanyConfiguration != null && !this.idCompanyConfiguration.equals(other.idCompanyConfiguration))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.CompanyConfiguration[ idCompanyConfiguration=" + idCompanyConfiguration + " ]";
    }

    public boolean getShowName() {
        return showName;
    }

    public void setShowName(boolean showName) {
        this.showName = showName;
    }
    
}
